Content creation systems continue to make advances in computing technologies to enhance digital images in various ways largely limited to professional photographers in the past. With these advances, content creation systems are able to generate professional quality digital images from digital images captured by device users with little to no experience or knowledge of rules for composing visually pleasing images, e.g., the rule of thirds. By way of example, content creation systems can analyze a digital image and, based on the analysis, select post-processing operations, such as cropping, zooming, filtering, and so on, to perform on the digital image. In some cases, these content creation systems use patch matching to carry out such image editing operations. Broadly speaking, patch matching involves copying values from a group of pixels in an image to the image's pixels that are affected by an operation. Consider an example in which patch matching is leveraged in connection with filling a hole of an image. To fill such a hole, patch matching may be leveraged to copy values of pixels that correspond to the remaining imagery to the pixels that correspond to the hole.
Conventional patch matching techniques attempt to locate a nearest patch (e.g., group of pixels) having pixel values that approximately match the pixels being edited by an image editing operation. In some scenarios, however, this mere nearest patch matching can result in edited images that are not semantically consistent. Consider an example in which a digital image of a person's face has a hole located at one of the person's eyes. Using conventional hole filling techniques that involve patch matching, this hole is filled based on patches of pixels nearby the hole, e.g., pixels corresponding to the person's brow, eye socket, cheek, nose, and so on. Merely copying values of these pixels to the hole pixels at the person's eye fails to reproduce an eye at the location though. Accordingly, conventional patch matching techniques may be unsuitable for implementing various image-editing operations.